xen/arm: Provide macros to help creating workaround helpers
authorJulien Grall <julien.grall@arm.com>
Thu, 4 Aug 2016 17:50:03 +0000 (18:50 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 4 Aug 2016 17:55:03 +0000 (10:55 -0700)
commit238ea8b2338d1465a244681e47bfc1172102dd6d
tree843d755f7ec023e45d015f49a968de61977d1f40
parent9193c7ac6c8e54b327a5d99fc40f5bde3e262da9
xen/arm: Provide macros to help creating workaround helpers

Workarounds may require to execute a different path when the platform
is affected by the associated erratum. Furthermore, this may need to
be called in the common code.

To avoid too much intrusion/overhead, the workaround helpers need to
be a nop on architecture which will never have the workaround and have
to be quick to check whether the platform requires it.

The alternative framework is used to transform the check in a single
instruction. When the framework is not available, the helper will have
~6 instructions including 1 instruction load.

The macro will create a handler called check_workaround_xxxxx with
xxxx the erratum number.

For instance, the line bellow will create a workaround helper for
erratum #424242 which is enabled when the capability
ARM64_WORKAROUND_424242 is set and only available for ARM64:

CHECK_WORKAROUND_HELPER(424242, ARM64_WORKAROUND_42424242, CONFIG_ARM64)

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/cpuerrata.h